{include file="admin/public/page_head.html"}
<div class="easyui-tabs" data-options="fit:true,border:false">
	<div title="{$html_title}" style="padding:20px;overflow:auto;">
		<div style="margin-top:5px;">
			<form method="post" action="?at=food&st=add_food_action" id="websit_config">
				<div id="stypestate" style="">
					<h2 class="h1">{$top_1_title}</h2>
					<div class="admin_table mb10">
						<table width="100%" cellspacing="0" cellpadding="0">
							<tr class="tr1 vt">
								<td class="td1">名称</td>
								<td id="bbsifopen" class="td2">
								<ul style="float:none;width:200px;" class="list_A cc">
									<li class="current">
										<input class="easyui-validatebox" name="cook_name" data-options="required:true,validType:'length[3,10]'">
									</li>
								</ul></td>
								<td class="td2">
								<div class="help_a" style="display: block;">
									.
								</div></td>
							</tr>
							<tr class="tr1 vt">
								<td class="td1">所属餐馆</td>
								<td class="td2">
								<select class="easyui-combobox" id="from_restaurant" name="from_restaurant" style="width:170px;" data-options="panelHeight: 'auto',url:'./index.php?at=restaurant&st=get_list&code=json',valueField:'id',
								textField:'restaurant_name'">
									<option value="0">请选择...</option>
								</select></td>
								<td class="td2">
								<div class="help_a" style="display: block;">
									.
								</div></td>
							</tr>
							<tr class="tr1 vt">
								<td class="td1">价格</td>
								<td class="td2">
								<input class="easyui-numberbox" name="cook_price" value="0" data-options="required:true,min:0,precision:2,prefix:'￥ '">
								</td>
								<td class="td2">
								<div class="help_a" style="display: block;">
									.
								</div></td>
							</tr>
						</table>
					</div>
					<div class="tac mb10">
						<span class="btn" id="submit"><span> <a href="#" class="easyui-linkbutton" id="form_action" data-options="plain:true,iconCls:'icon-save',disabled:1">递交</a> </span></span>
					</div>
				</div>
				<div style="display: none">
					<input id="cook_id" value="{$cook_id}" name="cook_id" />
					<input id="from_restaurant_name" value="" name="from_restaurant_name" />
				</div>
			</form>
		</div>
	</div>
</div>

{literal}
<script type="text/javascript">
	$(function() {
		var _cookID = $("#cook_id").val();
		if (_cookID != '') {
			// console.info(123);
			$("#websit_config").form({
				onLoadSuccess : function() {
					$("#form_action").linkbutton('enable');
				}
			})
			$("#websit_config").form('load', './index.php?at=user&st=info&code=json&id=' + _userID);

			$("input[name='user_password']").validatebox({
				required : 0
			});

			$("input[name='user_name']").attr('readonly', true);
		} else {
			$("#form_action").linkbutton('enable');
		}

		$("a", $("#submit")).click(function() {
			var _o = $("#form_action").linkbutton('options');
			if (_o.disabled) {
				alert('请等待，或数据获取出错...');
				return false;
			}

			if ($("#from_restaurant").combobox('getValue') * 1 == 0) {
				alert('请选择餐馆！');
				return false;
			} else {
				$("#from_restaurant_name").val($("#from_restaurant").combobox('getText'));
			}

			$("#websit_config").submit();
		})
	})
</script>
{/literal}
{include file="admin/public/page_foot.html"}